#ifndef __V_THREAD_H
#define __V_THREAD_H

#include "vglobal.h"

#ifdef __cplusplus
extern "C" {
#endif

V_DECLEAR_HANDLE(vThread);

typedef void *(*vThreadFunc)(vThread th,void *args);

vThread vThreadCreate(vThreadFunc func,void *args,int stack_size);

vThread vThreadCreateWithPriority(vThreadFunc func,void *args,int stack_size,int priority);


int vThreadDestroy(vThread th);

//该函数要在执行函数中使用
void vThreadSetName(const char *thread_name);

int vThreadKill(vThread th);
int vThreadCancel(vThread th);
int vThreadDetach(vThread th);

void vThreadSleep(int ms);

#ifdef __cplusplus
}
#endif

#endif
